package cn.com.connext.scrm.repository.master;


import cn.com.connext.scrm.domain.master.DwaConvertCode;
import cn.com.connext.scrm.domain.master.DwaGetCoupon;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface DwaConvertCodeRepository extends JpaRepository<DwaConvertCode, String>, JpaSpecificationExecutor {

    DwaConvertCode findByUnionId(String unionId);
    @Query(value ="select d from  DwaConvertCode d where d.isUse = 1")
    List<DwaConvertCode> getRandomEntity();
}
